home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 March
/
PCWorld_2007-03_cd.bin
/
domacnost a kancelar
/
scribus
/
scribus-1.3.3.7-win32-install.exe
/
share
/
samples
/
legende.py
< prev
next >
Wrap
Text File
|
2004-12-14
|
907b
|
40 lines
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" When you have an image selected this script creates small text legende
(caption) below the image. The new textframe contains name of the file. """
import sys
try:
from scribus import *
except ImportError:
print "This script only runs from within Scribus."
sys.exit(1)
import os
def main():
userUnit = getUnit()
setUnit(1)
sel_count = selectionCount()
if sel_count == 0:
messageBox("legende.py",
"Please select the object to add a caption to before running this script.",
ICON_INFORMATION)
sys.exit(1)
x,y = getPosition()
l,h = getSize()
texte = getImageFile()
image = os.path.basename(texte)
a = createText(x,y+h+2,l,8)
insertText(image,0,a)
setTextAlignment(2,a)
setFontSize(7,a)
setUnit(userUnit)
if __name__ == '__main__':
main()